/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package answerquestion_simple;
import jess.Rete;
//import edu.stanford.nlp.trees.*;
//import edu.stanford.nlp.parser.lexparser.LexicalizedParser;

/**
 *
 * @author Huynh Ngoc Khue
 */

public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try{
        
           JessRuleDeftemplate rd = new JessRuleDeftemplate();
           rd.MakeTemplate();
           rd.MakeRule();
           Rete rete = rd.getRete_Engine();
           AddWorkingMemory add = new AddWorkingMemory();
           Parser parser = new Parser();
           //-------------- cau khang dinh-----------

           parser.MakeParser("Cuong eat meat .");
           String sta = parser.getResult();
           add.CreateListTemplate(sta, 1);
           //-------------- cau hoi------------------
           parser.MakeParser("Who eat meat ?");
           sta = "";
           sta = parser.getResult();
           add.CreateListTemplate(sta, 0);
           add.AddFact(rete);
           rete.run();
           rete.eval("(facts)");
           
        }
        catch(Exception e)
        {
            System.out.println("error in Main Fuction" + e.toString());
        }
    }

}
